\hypertarget{comm__can_8h}{}\section{comm\+\_\+can.\+h File Reference}
\label{comm__can_8h}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
{\ttfamily \#include \char`\"{}conf\+\_\+general.\+h\char`\"{}}\\*
\subsection*{Macros}
\begin{DoxyCompactItemize}
\item 
\#define \hyperlink{comm__can_8h_ada66a3c7dd1c06dc22281901ffaae875}{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+\_\+\+I\+N\+T\+\_\+\+M\+S}~1
\item 
\#define \hyperlink{comm__can_8h_a24af6fd74669018fe67d375b4c01906b}{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+S\+\_\+\+T\+O\+\_\+\+S\+T\+O\+R\+E}~10
\end{DoxyCompactItemize}
\subsection*{Functions}
\begin{DoxyCompactItemize}
\item 
void \hyperlink{comm__can_8h_a302ba7cbfee5982fc40432898ed7413e}{comm\+\_\+can\+\_\+init} (void)
\item 
void \hyperlink{comm__can_8h_a7c87045186a1caa3f5bfdd575662ae34}{comm\+\_\+can\+\_\+transmit} (uint32\+\_\+t id, uint8\+\_\+t $\ast$data, uint8\+\_\+t len)
\item 
void \hyperlink{comm__can_8h_a455666cd97a43c5cc47faae48ede921a}{comm\+\_\+can\+\_\+send\+\_\+buffer} (uint8\+\_\+t controller\+\_\+id, uint8\+\_\+t $\ast$data, unsigned int len, bool send)
\item 
void \hyperlink{comm__can_8h_a3f891e2d3bf32446f30cf408608be422}{comm\+\_\+can\+\_\+set\+\_\+duty} (uint8\+\_\+t controller\+\_\+id, float duty)
\item 
void \hyperlink{comm__can_8h_a51aea08052617feacfa5144face7f705}{comm\+\_\+can\+\_\+set\+\_\+current} (uint8\+\_\+t controller\+\_\+id, float current)
\item 
void \hyperlink{comm__can_8h_aabb9e177ea86329e2be041be574216a2}{comm\+\_\+can\+\_\+set\+\_\+current\+\_\+brake} (uint8\+\_\+t controller\+\_\+id, float current)
\item 
void \hyperlink{comm__can_8h_a85f12e68cccc19841a5b16472c39562f}{comm\+\_\+can\+\_\+set\+\_\+rpm} (uint8\+\_\+t controller\+\_\+id, float rpm)
\item 
void \hyperlink{comm__can_8h_a864403d24c94cc7cfc0f389c24ab616c}{comm\+\_\+can\+\_\+set\+\_\+pos} (uint8\+\_\+t controller\+\_\+id, float pos)
\item 
\hyperlink{structcan__status__msg}{can\+\_\+status\+\_\+msg} $\ast$ \hyperlink{comm__can_8h_a666e73b6080965cadc4028050a7742c6}{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+index} (int index)
\item 
\hyperlink{structcan__status__msg}{can\+\_\+status\+\_\+msg} $\ast$ \hyperlink{comm__can_8h_a1214fd3165e8db4a0a1a6cd8c12e0dea}{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+id} (int id)
\end{DoxyCompactItemize}


\subsection{Macro Definition Documentation}
\hypertarget{comm__can_8h_ada66a3c7dd1c06dc22281901ffaae875}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+\_\+\+I\+N\+T\+\_\+\+M\+S@{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+\_\+\+I\+N\+T\+\_\+\+M\+S}}
\index{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+\_\+\+I\+N\+T\+\_\+\+M\+S@{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+\_\+\+I\+N\+T\+\_\+\+M\+S}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+\_\+\+I\+N\+T\+\_\+\+M\+S}]{\setlength{\rightskip}{0pt plus 5cm}\#define C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+\_\+\+I\+N\+T\+\_\+\+M\+S~1}\label{comm__can_8h_ada66a3c7dd1c06dc22281901ffaae875}
\hypertarget{comm__can_8h_a24af6fd74669018fe67d375b4c01906b}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+S\+\_\+\+T\+O\+\_\+\+S\+T\+O\+R\+E@{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+S\+\_\+\+T\+O\+\_\+\+S\+T\+O\+R\+E}}
\index{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+S\+\_\+\+T\+O\+\_\+\+S\+T\+O\+R\+E@{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+S\+\_\+\+T\+O\+\_\+\+S\+T\+O\+R\+E}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+S\+\_\+\+T\+O\+\_\+\+S\+T\+O\+R\+E}]{\setlength{\rightskip}{0pt plus 5cm}\#define C\+A\+N\+\_\+\+S\+T\+A\+T\+U\+S\+\_\+\+M\+S\+G\+S\+\_\+\+T\+O\+\_\+\+S\+T\+O\+R\+E~10}\label{comm__can_8h_a24af6fd74669018fe67d375b4c01906b}


\subsection{Function Documentation}
\hypertarget{comm__can_8h_a1214fd3165e8db4a0a1a6cd8c12e0dea}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+id@{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+id}}
\index{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+id@{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+id}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+id(int id)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf can\+\_\+status\+\_\+msg}$\ast$ comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+id (
\begin{DoxyParamCaption}
\item[{int}]{id}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a1214fd3165e8db4a0a1a6cd8c12e0dea}
Get status message by id.


\begin{DoxyParams}{Parameters}
{\em id} & Id of the controller that sent the status message.\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The message or 0 for an invalid id. 
\end{DoxyReturn}
\hypertarget{comm__can_8h_a666e73b6080965cadc4028050a7742c6}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+index@{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+index}}
\index{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+index@{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+index}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+index(int index)}]{\setlength{\rightskip}{0pt plus 5cm}{\bf can\+\_\+status\+\_\+msg}$\ast$ comm\+\_\+can\+\_\+get\+\_\+status\+\_\+msg\+\_\+index (
\begin{DoxyParamCaption}
\item[{int}]{index}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a666e73b6080965cadc4028050a7742c6}
Get status message by index.


\begin{DoxyParams}{Parameters}
{\em index} & Index in the array\\
\hline
\end{DoxyParams}
\begin{DoxyReturn}{Returns}
The message or 0 for an invalid index. 
\end{DoxyReturn}
\hypertarget{comm__can_8h_a302ba7cbfee5982fc40432898ed7413e}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+init@{comm\+\_\+can\+\_\+init}}
\index{comm\+\_\+can\+\_\+init@{comm\+\_\+can\+\_\+init}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+init(void)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+init (
\begin{DoxyParamCaption}
\item[{void}]{}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a302ba7cbfee5982fc40432898ed7413e}
\hypertarget{comm__can_8h_a455666cd97a43c5cc47faae48ede921a}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+send\+\_\+buffer@{comm\+\_\+can\+\_\+send\+\_\+buffer}}
\index{comm\+\_\+can\+\_\+send\+\_\+buffer@{comm\+\_\+can\+\_\+send\+\_\+buffer}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+send\+\_\+buffer(uint8\+\_\+t controller\+\_\+id, uint8\+\_\+t $\ast$data, unsigned int len, bool send)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+send\+\_\+buffer (
\begin{DoxyParamCaption}
\item[{uint8\+\_\+t}]{controller\+\_\+id, }
\item[{uint8\+\_\+t $\ast$}]{data, }
\item[{unsigned int}]{len, }
\item[{bool}]{send}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a455666cd97a43c5cc47faae48ede921a}
Send a buffer up to R\+X\+\_\+\+B\+U\+F\+F\+E\+R\+\_\+\+S\+I\+Z\+E bytes as fragments. If the buffer is 6 bytes or less it will be sent in a single C\+A\+N frame, otherwise it will be split into several frames.


\begin{DoxyParams}{Parameters}
{\em controller\+\_\+id} & The controller id to send to.\\
\hline
{\em data} & The payload.\\
\hline
{\em len} & The payload length.\\
\hline
{\em send} & If true, this packet will be passed to the send function of commands. Otherwise, it will be passed to the process function. \\
\hline
\end{DoxyParams}
\hypertarget{comm__can_8h_a51aea08052617feacfa5144face7f705}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+set\+\_\+current@{comm\+\_\+can\+\_\+set\+\_\+current}}
\index{comm\+\_\+can\+\_\+set\+\_\+current@{comm\+\_\+can\+\_\+set\+\_\+current}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+set\+\_\+current(uint8\+\_\+t controller\+\_\+id, float current)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+set\+\_\+current (
\begin{DoxyParamCaption}
\item[{uint8\+\_\+t}]{controller\+\_\+id, }
\item[{float}]{current}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a51aea08052617feacfa5144face7f705}
\hypertarget{comm__can_8h_aabb9e177ea86329e2be041be574216a2}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+set\+\_\+current\+\_\+brake@{comm\+\_\+can\+\_\+set\+\_\+current\+\_\+brake}}
\index{comm\+\_\+can\+\_\+set\+\_\+current\+\_\+brake@{comm\+\_\+can\+\_\+set\+\_\+current\+\_\+brake}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+set\+\_\+current\+\_\+brake(uint8\+\_\+t controller\+\_\+id, float current)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+set\+\_\+current\+\_\+brake (
\begin{DoxyParamCaption}
\item[{uint8\+\_\+t}]{controller\+\_\+id, }
\item[{float}]{current}
\end{DoxyParamCaption}
)}\label{comm__can_8h_aabb9e177ea86329e2be041be574216a2}
\hypertarget{comm__can_8h_a3f891e2d3bf32446f30cf408608be422}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+set\+\_\+duty@{comm\+\_\+can\+\_\+set\+\_\+duty}}
\index{comm\+\_\+can\+\_\+set\+\_\+duty@{comm\+\_\+can\+\_\+set\+\_\+duty}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+set\+\_\+duty(uint8\+\_\+t controller\+\_\+id, float duty)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+set\+\_\+duty (
\begin{DoxyParamCaption}
\item[{uint8\+\_\+t}]{controller\+\_\+id, }
\item[{float}]{duty}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a3f891e2d3bf32446f30cf408608be422}
\hypertarget{comm__can_8h_a864403d24c94cc7cfc0f389c24ab616c}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+set\+\_\+pos@{comm\+\_\+can\+\_\+set\+\_\+pos}}
\index{comm\+\_\+can\+\_\+set\+\_\+pos@{comm\+\_\+can\+\_\+set\+\_\+pos}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+set\+\_\+pos(uint8\+\_\+t controller\+\_\+id, float pos)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+set\+\_\+pos (
\begin{DoxyParamCaption}
\item[{uint8\+\_\+t}]{controller\+\_\+id, }
\item[{float}]{pos}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a864403d24c94cc7cfc0f389c24ab616c}
\hypertarget{comm__can_8h_a85f12e68cccc19841a5b16472c39562f}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+set\+\_\+rpm@{comm\+\_\+can\+\_\+set\+\_\+rpm}}
\index{comm\+\_\+can\+\_\+set\+\_\+rpm@{comm\+\_\+can\+\_\+set\+\_\+rpm}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+set\+\_\+rpm(uint8\+\_\+t controller\+\_\+id, float rpm)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+set\+\_\+rpm (
\begin{DoxyParamCaption}
\item[{uint8\+\_\+t}]{controller\+\_\+id, }
\item[{float}]{rpm}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a85f12e68cccc19841a5b16472c39562f}
\hypertarget{comm__can_8h_a7c87045186a1caa3f5bfdd575662ae34}{}\index{comm\+\_\+can.\+h@{comm\+\_\+can.\+h}!comm\+\_\+can\+\_\+transmit@{comm\+\_\+can\+\_\+transmit}}
\index{comm\+\_\+can\+\_\+transmit@{comm\+\_\+can\+\_\+transmit}!comm\+\_\+can.\+h@{comm\+\_\+can.\+h}}
\subsubsection[{comm\+\_\+can\+\_\+transmit(uint32\+\_\+t id, uint8\+\_\+t $\ast$data, uint8\+\_\+t len)}]{\setlength{\rightskip}{0pt plus 5cm}void comm\+\_\+can\+\_\+transmit (
\begin{DoxyParamCaption}
\item[{uint32\+\_\+t}]{id, }
\item[{uint8\+\_\+t $\ast$}]{data, }
\item[{uint8\+\_\+t}]{len}
\end{DoxyParamCaption}
)}\label{comm__can_8h_a7c87045186a1caa3f5bfdd575662ae34}
